package com.andyage.admin.service.impl;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Service;

import com.andyage.admin.dao.AdUserMapper;
import com.andyage.admin.service.IAdUserService;
import com.andyage.util.JsonContent;
import com.andyage.admin.bean.AduserBean;

@Service
public class AdUserServiceImpl implements IAdUserService {
	public String CONTENT_TYPE = "text/html;charset=utf-8";
	@Resource
	private AdUserMapper adUserMapper;

	@Override
	public void queryAllAdUserByCondition(AduserBean adUserBean,HttpServletRequest request,HttpServletResponse response) throws Exception {
		
		List<AduserBean> list=adUserMapper.queryAllAdUserByCondition(adUserBean);
		int total=adUserMapper.queryAllUserByCount(adUserBean);
		String jsonObject=JsonContent.getJsonArray(list, total);
		response.setContentType(CONTENT_TYPE);
		response.getWriter().print(jsonObject);
		
	}

}
